{% extends "layout.html" %} 
{% block content %}
  <div class="layui-row">
     <a href="/user/add/" class="layui-btn layui-btn-sm"><i class="layui-icon">&#xe654;</i>新建用户(原始方式)</a>
     <a href="/user/model/form/add/" class="layui-btn layui-btn-sm"><i class="layui-icon">&#xe654;</i>新建用户(ModelForm)</a>
  </div>
  <div class="layui-row">
    <table class="layui-table">
      <colgroup>
        <col width="100">
        <col>
        <col>
      </colgroup>
      <thead>
        <tr>
          <th>ID</th>
          <th>姓名</th>
          <th>密码</th>
          <th>年龄</th>
          <th>账户余额</th>
          <th>入职时间</th>
          <th>性别</th>
          <th>所属部门</th>
          <th>操作</th>
        </tr> 
      </thead>
      <tbody>
      {% for item in data_list %}
        <tr>
          <td>{{item.id}}</td>
          <td>{{item.name}}</td>
          <td>{{item.password}}</td>
          <td>{{item.age}}</td>
          <td>{{item.account}}</td>
          <td>{{item.create_time|date:"Y-m-d"}}</td>
          <td>{{item.get_gender_display}}</td>
          <td>{{item.depart.title}}</td>
          <td>
               <a href="/user/{{item.id}}/edit/" class="layui-btn layui-btn-sm ">编辑</a>
              <a href="/user/delete/?user_id={{item.id}}" class="layui-btn layui-btn-sm layui-btn-danger" target="_blank">删除</a>
          </td>
        </tr>
      {% endfor %}
      </tbody>
    </table>
  </div>
{% endblock %}
